package com.sztx.worker_monitor.web.model;

import com.sztx.se.core.tbschedule.config.ScheduleParameter;

public class TbsModel {
	private String 		strategyName;
	private String 		scheduleName;
	private String 		taskName;
	private String 		taskBean;
	private String 		heartBeatRate;			//(s)
	private String 		judgeDeadInterval;		//(s)
	private Integer 	threadNumber;	
	private Integer 	fetchDataNumber;	
	private Integer 	executeNumber;
	private String 		sleepTimeNoData;		//s
	private DealType 	processType;
	private String 		sleepTimeInterval;		//s
	private String 		cleanDealEareTime;		//h
	private String 		startTime;
	private String 		endTime;
	private Integer 	maxTaskItemsOfOneThreadGroup;
	private String 		extraInfo;
	private String 		taskItems;
	private String 		status;
	
	
	public TbsModel() {
		super();
	}
	
	

	public TbsModel(String strategyName, String scheduleName, String taskName,
			String taskBean, String heartBeatRate, String judgeDeadInterval,
			Integer threadNumber, Integer fetchDataNumber,
			Integer executeNumber, String sleepTimeNoData,
			DealType processType, String sleepTimeInterval,
			String cleanDealEareTime, String startTime, String endTime,
			Integer maxTaskItemsOfOneThreadGroup, String extraInfo,
			String taskItems,
			String 		status) {
		super();
		this.strategyName = strategyName;
		this.scheduleName = scheduleName;
		this.taskName = taskName;
		this.taskBean = taskBean;
		this.heartBeatRate = heartBeatRate;
		this.judgeDeadInterval = judgeDeadInterval;
		this.threadNumber = threadNumber;
		this.fetchDataNumber = fetchDataNumber;
		this.executeNumber = executeNumber;
		this.sleepTimeNoData = sleepTimeNoData;
		this.processType = processType;
		this.sleepTimeInterval = sleepTimeInterval;
		this.cleanDealEareTime = cleanDealEareTime;
		this.startTime = startTime;
		this.endTime = endTime;
		this.maxTaskItemsOfOneThreadGroup = maxTaskItemsOfOneThreadGroup;
		this.extraInfo = extraInfo;
		this.taskItems = taskItems;
		this.status = status;
	}

	public TbsModel(ScheduleParameter scheduleParameter){
		if(scheduleParameter == null) return ;
		this.strategyName 	= scheduleParameter.getStrategyName();
		this.scheduleName 	= scheduleParameter.getScheduleName();
		this.taskName 		= scheduleParameter.getTaskName();
		this.taskBean 		= scheduleParameter.getTaskBeanName();
		this.heartBeatRate 	= scheduleParameter.getHeartBeatRate()/1000.0 +"";
		this.judgeDeadInterval = scheduleParameter.getJudgeDeadInterval()/1000.0 +"";
		this.threadNumber 	= scheduleParameter.getThreadNumber();
		this.fetchDataNumber= scheduleParameter.getFetchDataNumber();
		this.executeNumber 	= scheduleParameter.getExecuteNumber();
		this.sleepTimeNoData= scheduleParameter.getSleepTimeNoData()/1000.0 +"";
		this.processType 	= DealType.LoadDealType(scheduleParameter.getProcessType());
		this.sleepTimeInterval = scheduleParameter.getSleepTimeInterval()/1000.0 +"";
		this.cleanDealEareTime = scheduleParameter.getExpireOwnSignInterval()*24+"";
		this.startTime 		= scheduleParameter.getStartTime()==null?"":scheduleParameter.getStartTime();
		this.endTime 		= scheduleParameter.getEndTime()==null?"":scheduleParameter.getEndTime();
		this.maxTaskItemsOfOneThreadGroup = scheduleParameter.getMaxTaskItemsOfOneThreadGroup();
		this.extraInfo 		= scheduleParameter.getExtraInfo()==null?"":scheduleParameter.getExtraInfo();
		this.taskItems 		= "";
		this.status 		= scheduleParameter.getStatus();
		boolean bfirst = true;
		for(String taskItem : scheduleParameter.getTaskItemList()){
			if(!bfirst)
				this.taskItems +=";";
			this.taskItems +=taskItem;
			bfirst = false;
		}
	}


	public String getStatus() {
		return status;
	}



	public void setStatus(String status) {
		this.status = status;
	}



	public String getStrategyName() {
		return strategyName;
	}



	public void setStrategyName(String strategyName) {
		this.strategyName = strategyName;
	}



	public String getScheduleName() {
		return scheduleName;
	}


	public void setScheduleName(String scheduleName) {
		this.scheduleName = scheduleName;
	}


	public String getTaskName() {
		return taskName;
	}


	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getTaskBean() {
		return taskBean;
	}
	public void setTaskBean(String taskBean) {
		this.taskBean = taskBean;
	}
	public String getHeartBeatRate() {
		return heartBeatRate;
	}
	public void setHeartBeatRate(String heartBeatRate) {
		this.heartBeatRate = heartBeatRate;
	}
	public String getJudgeDeadInterval() {
		return judgeDeadInterval;
	}
	public void setJudgeDeadInterval(String judgeDeadInterval) {
		this.judgeDeadInterval = judgeDeadInterval;
	}
	public Integer getThreadNumber() {
		return threadNumber;
	}
	public void setThreadNumber(Integer threadNumber) {
		this.threadNumber = threadNumber;
	}
	public Integer getFetchDataNumber() {
		return fetchDataNumber;
	}
	public void setFetchDataNumber(Integer fetchDataNumber) {
		this.fetchDataNumber = fetchDataNumber;
	}
	public Integer getExecuteNumber() {
		return executeNumber;
	}
	public void setExecuteNumber(Integer executeNumber) {
		this.executeNumber = executeNumber;
	}
	public String getSleepTimeNoData() {
		return sleepTimeNoData;
	}
	public void setSleepTimeNoData(String sleepTimeNoData) {
		this.sleepTimeNoData = sleepTimeNoData;
	}
	public DealType getProcessType() {
		return processType;
	}
	public void setProcessType(DealType processType) {
		this.processType = processType;
	}
	public String getSleepTimeInterval() {
		return sleepTimeInterval;
	}
	public void setSleepTimeInterval(String sleepTimeInterval) {
		this.sleepTimeInterval = sleepTimeInterval;
	}
	public String getCleanDealEareTime() {
		return cleanDealEareTime;
	}
	public void setCleanDealEareTime(String cleanDealEareTime) {
		this.cleanDealEareTime = cleanDealEareTime;
	}
	public String getStartTime() {
		return startTime;
	}
	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}
	public String getEndTime() {
		return endTime;
	}
	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	public Integer getMaxTaskItemsOfOneThreadGroup() {
		return maxTaskItemsOfOneThreadGroup;
	}
	public void setMaxTaskItemsOfOneThreadGroup(Integer maxTaskItemsOfOneThreadGroup) {
		this.maxTaskItemsOfOneThreadGroup = maxTaskItemsOfOneThreadGroup;
	}
	public String getExtraInfo() {
		return extraInfo;
	}
	public void setExtraInfo(String extraInfo) {
		this.extraInfo = extraInfo;
	}
	public String getTaskItems() {
		return taskItems;
	}
	public void setTaskItems(String taskItems) {
		this.taskItems = taskItems;
	}
	
	
	
	
	
}
